<template>
	<view class="desserts">
		<scroll-view class="left" scroll-y="false">
			<!-- :class="active===index?'active':''"
		v-for="(item,index) in cates" -->
				<view @click="leftClick(index)" 
			:class="active===index?'active':''"
			>推荐</view>
				<view>盒子蛋糕</view>
				<view>雪胖大福</view>
				<view>生日蛋糕</view>
				<view>千层蛋糕</view>
				<view>布丁小贝</view>
				<view>吐司面包</view>
		</scroll-view>
		<view class="desserts-list">
			<view class="desserts-item">
				<navigator class="confirm" open-type="switchTab" hover-class="other-navigator-hover">
					<image src="../../static/img/下载%20(4).jpg" @click="navClick()"></image>
				</navigator>
				<view class="content">
					<view>蛋糕</view>
					<view>￥45</view>
					<view>月销44</view>
					<view>好评度89%</view>
				</view>
				<view class="img">
					<image src="../../static/img/加号.png"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cates: [],
				active: 0
			}
		},
	}
</script>

<style lang="scss">
	.desserts {
		height: 100%;
		display: flex;
		justify-content: space-between;
	
		.left {
			width: 180rpx;
			height: 100%;
			border-right: 1px solid #eee;
	
			view {
				width: 60px;
				line-height: 40px;
				text-align: center;
				color: #333;
				font-size: 30rpx;
				border-top: 1px solid #eee;
			}
	
			.active {
				background: $shop-color;
			}
		}
	.desserts-list {
		padding: 10rpx 0;
		justify-content: space-between;
		width: 100%;
		height: 200rpx;

		.desserts-item {
			background-color: #FFFDEF;
			width: 100%;
			margin: 10rpx 0;
			box-sizing: border-box;
			display: flex;

			image {
				margin: 10rpx 0 10rpx 20rpx;
				width: 150rpx;
				height: 150rpx;
				border-radius: 10rpx;
			}

			.content {
				margin-left: 10rpx;
				margin: 5rpx 0 5rpx 10rpx;
				font-size: 32rpx;
				line-height: 40rpx;

				text:nth-child(2) {
					padding: 0 8px;
				}

			}

			.img {
				display: flex;
				margin: 90rpx 0 0 160rpx;

				image {
					width: 60rpx;
					height: 60rpx;
				}
			}

		}

	}
	}
</style>
